package com.shallowUniverse.process.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.shallowUniverse.process.entity.ProcessDefinition;
import com.shallowUniverse.process.exception.ProcessNotCompletedException;

import java.util.List;

/**
 * @author gs
 * @date create in 2020/12/11 17:04
 */
public interface ProcessDefinitionService {

    /**
     * description: 获取所有流程 <br/>
     * author: Shuai Guo   <br/>
     * date: 2021/7/20 <br/>
     * params: [processDefinition] <br/>
     * return: java.util.List<com.qianyu.process.entity.ProcessDefinition> <br/>
     * version: 1.0
     * @param processDefinition
     */
    List<ProcessDefinition> find(ProcessDefinition processDefinition);

    /**
     * description: 根据id查找流程 <br/>
     * author: Shuai Guo   <br/>
     * date: 2021/7/20 <br/>
     * params: [id] <br/>
     * return: com.qianyu.process.entity.ProcessDefinition <br/>
     * version: 1.0
     */
    ProcessDefinition findById(Long id);

    /**
     * description: 保存流程 <br/>
     * author: Shuai Guo   <br/>
     * date: 2021/7/20 <br/>
     * params: [processDefinition] <br/>
     * return: int <br/>
     * version: 1.0
     */
    int save(ProcessDefinition processDefinition);

    /**
     * description: 删除流程 <br/>
     * author: Shuai Guo   <br/>
     * date: 2021/7/20 <br/>
     * params: [ids, isLogic] <br/>
     * return: int <br/>
     * version: 1.0
     */
    int remove(List<Long> ids, boolean isLogic) throws ProcessNotCompletedException;

    /**
     * description: 分页查询 <br/>
     * author: Shuai Guo   <br/>
     * date: 2021/7/20 <br/>
     * params: [page,processDefinition] <br/>
     * return: com.baomidou.mybatisplus.core.metadata.IPage<com.qianyu.process.entity.ProcessDefinition> <br/>
     * version: 1.0
     */
    IPage<ProcessDefinition> findPage(IPage<ProcessDefinition> page, ProcessDefinition processDefinition);
}
